#ifndef LONGKEY_COMMON_SECURITY_SHA1_H_
#define LONGKEY_COMMON_SECURITY_SHA1_H_

#include "inttypes.h"
#include "hash-internal.h"

#ifdef __cplusplus
extern "C" {
#endif // __cplusplus

	typedef HASH_CTX SHA_CTX;

	void SHA_init(SHA_CTX* ctx);
	void SHA_update(SHA_CTX* ctx, const void* data, int len);
	const uint8_t* SHA_final(SHA_CTX* ctx);

	// Convenience method. Returns digest address.
	const uint8_t* SHA(const void* data, int len, uint8_t* digest);

#define SHA_DIGEST_SIZE 20

#ifdef __cplusplus
}
#endif // __cplusplus

#endif	// LONGKEY_COMMON_SECURITY_SHA1_H_